www.gusucode.com > 落叶冰点万能企业网站内容管理系统 V9.1 > 落叶冰点万能企业网站内容管理系统 V9.1\code\admin\adminModel\D_chk_edit_class.asp

    <%


'**************************************************************
' 新动软网站管理系统
' 官方网站: http://www.aspcpu.com
' 系统作者: 阮丁远(网名:天下程序)
' Copyright 新动软网站管理系统 版权所有
'**************************************************************


%>





<LINK href="../css.css" type=text/css rel=stylesheet>
<%

dir_set="../../"


%>


<!--#include file=../../inc/conn.asp-->
<!--#include file=../../inc/Functionb.asp-->

<!--#include file=../../inc/ajaxLIB.asp-->

<!--#include file=../inc/checkadmin2.asp-->

<!--#include file=../../inc/functionFiless.asp-->






<%
AJAXshowLoader()


%>



	<%



biao=trim(request("biao"))



if qx_if_max=0 then


response.redirect "../D_suodinguser.asp"
end if









err1=0

if request("nme")="" then
err1=1
%>
<script language="javascript">
alert("请填写分类名称");
history.go(-1);

</script>



<%
end if

if request("classid")=request("id") then



err1=1
%>
<script language="javascript">
alert("所属分类不能指定为自己");
history.go(-1);

</script>



<%




end if


if isnumeric(request("orders"))=0 then



err1=1
%>
<script language="javascript">
alert("顺序号必须为数字");
history.go(-1);

</script>



<%




end if

if request("classid")="xx" then
rrr2="0"
else

set rs44=server.CreateObject("adodb.recordset")
rs44.open "select * from "&biao&" where id="&request("classid"),conn,1,3


rrr2=rs44("parent_id_list")
rrr3=rs44("parent_id")
end if

if instr(1,rrr2,","&cstr(request("id"))&",",1)<>0  or cstr(request("id"))=cstr(rrr3) then




err1=1
%>
<script language="javascript">
alert("不能移动到自己的子分类下面");
history.go(-1);

</script>



<%




end if















if err1=0 then

  
set rs=server.CreateObject("adodb.recordset")


  
  
rs.open "select * from "&biao&" where id="&request("id"),conn,1,3






rs("classname")=trim(request("nme"))
rs("orders")=request("orders")
rs("titleColor")=request("ColorModes")
rs("titleFont")=request("FontModes")

yuan_parent_id_list=rs("parent_id_list")
yuan_parent_id_list_b=rs("parent_id_list")&","&rs("id")
yuan_deepth=rs("deepth")

classid=request("classid")
if classid="xx" then
rs("parent_id")="0"
rs("parent_id_list")="0"
rrrri="0"
rs("deepth")=0
else

rs("parent_id")=classid



set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from "&biao&" where id="&classid,conn,1,3

pidlist=rs1("parent_id_list")

rs("parent_id_list")=pidlist&","&classid
rrrri=pidlist&","&classid
sss1=ubound(split(pidlist&","&classid,","))
rs("deepth")=sss1
end if
new_parent_id_list_b=rs("parent_id_list")&","&rs("id")
yidong_deepth=ubound(split(rrrri,","))-yuan_deepth







set rs33=server.CreateObject("adodb.recordset")
rs33.open "select * from "&biao&"  where parent_id_list like '%"&yuan_parent_id_list_b&"%'",conn,1,3
do while not rs33.eof






if len(rs33("parent_id_list"))-len(yuan_parent_id_list_b)<>0 then
cha=right(rs33("parent_id_list"),len(rs33("parent_id_list"))-len(yuan_parent_id_list_b))



else
cha=""

end if
'new_parent_id_list_b_b=new_parent_id_list_b&cha
if classid="xx" then

new_parent_id_list_b_b="0,"&request("id")&cha

else

new_parent_id_list_b_b=rs1("parent_id_list")&","&rs1("id")&","&request("id")&cha


end if



rs33("parent_id_list")=new_parent_id_list_b_b

sss1=ubound(split(new_parent_id_list_b_b,","))
rs33("deepth")=rs33("deepth")+yidong_deepth
rs33.update
rs33.movenext
loop










rs("is_open_use_blank")=request("LinkTarget")
rs("is_link_class")=request("isoutLink")

rs("outlink")=request("TurnLinkUrl")

%>
<script language="javascript">
alert("修改成功");
self.location="D_admin_models_classbiao.asp?biao=<%=biao%>";

</script>



<%

rs.update

end if



%>



<%
AJAXcloseLoader()
%>